package com.woniu.command.equipmentCommand;

import com.woniu.command.Command;
import com.woniu.command.handle.EquipmentCommandHandle;
import com.woniu.outlet.po.Equipment;
import com.woniu.util.ApplicationContextHolder;
import org.springframework.beans.factory.annotation.Autowired;

public class AddEquipmentCommand implements Command<Equipment,Integer> {

    @Autowired
    private EquipmentCommandHandle handler;

    public AddEquipmentCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext().getBean(EquipmentCommandHandle.class);
    }

    @Override
    public Integer excute(Equipment equipment) {
        return this.handler.addEquipment(equipment);
    }
}
